package org.jeecg.modules.message.job;

import com.baomidou.dynamic.datasource.annotation.DS;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.modules.demo.pcl.mapper.PclMinmaxMoniterMapper;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.HashMap;
import java.util.Map;

/**
 * TPM自动任务
 * @author: jeecg-boot
 */

@Slf4j
@DS("mes-alm-datasource")
public class TpmAutoJob implements Job {
    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        String yearMonth = "2025-02"; // 示例输入的年月
        String woQuery = "SELECT wo_id, wo_name FROM amtc_wo WHERE wo_type_id = 25 AND wo_status <> 'APPROVED'";
        String scoreQuery = "SELECT act_value FROM amtc_wo_checklist WHERE wo_id = ?";
        Map<String, Double> totalScores = new HashMap<>(); // 存储每个wo_name的总分
        Map<String, Integer> countScores = new HashMap<>(); // 存储每个wo_name的分数计数
        //1.查询所有今日要处理的数据
        //2.处理数据：循环1关联查询所有子项计算平均值
        //3.插入数据：①所属年月 ②平均值 ③班组名 ④创建时间
    }
}
